package com.practise.rocketmqdemo.listen;

import com.practise.rocketmqdemo.constant.MQConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 ** 顺序消费
 */
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "cgroup1", topic = MQConstant.TOPIC_ORDER,consumeMode = ConsumeMode.ORDERLY )
public class TopicOrderReceiver implements RocketMQListener {

    @Override
    public void onMessage(Object msg) {
        log.info("监听:cgroup1 TOPIC_ORDER msg:{}" ,msg);
    }
}